import 'package:flutter/material.dart';
import 'package:flex_color_scheme/flex_color_scheme.dart';

class AppThemes {
  // 亮色主题配置
  static ThemeData lightTheme = FlexThemeData.light(
    scheme: FlexScheme.blueM3, // 主题色调方案
    bottomAppBarElevation: 4.0, // 设置底部 AppBar 的阴影高度
    tabBarStyle: FlexTabBarStyle.forBackground, // 设置 TabBar 样式
    subThemesData: const FlexSubThemesData(
      // 子主题配置
      interactionEffects: false, // 是否启用交互效果
      tintedDisabledControls: false, // 禁用控件时不添加色调
      blendOnLevel: 10, // 设置 blend 层级
      blendOnColors: false, // 是否启用颜色混合
      blendTextTheme: true, // 是否启用文本主题混合
      useTextTheme: true, // 是否使用文本主题
      thinBorderWidth: 0.5, // 边框宽度
      defaultRadius: 5.0, // 默认圆角半径
      appBarBackgroundSchemeColor: SchemeColor.surfaceVariant, // AppBar 背景色方案
      appBarScrolledUnderElevation: 19.5, // 滑动时 AppBar 下方的阴影高度
      bottomNavigationBarElevation: 2.0, // 设置底部导航栏的阴影高度
      bottomNavigationBarBackgroundSchemeColor:
          SchemeColor.surfaceVariant, // 设置底部导航栏的背景色方案
      navigationBarSelectedLabelSchemeColor: SchemeColor.secondary, // 选中标签的颜色方案
      navigationBarUnselectedLabelSchemeColor:
          SchemeColor.onSurface, // 未选中标签的颜色方案
      navigationBarMutedUnselectedLabel: false, // 禁用未选中标签的颜色变暗效果
      navigationBarSelectedIconSchemeColor: SchemeColor.secondary, // 选中图标的颜色方案
      navigationBarUnselectedIconSchemeColor:
          SchemeColor.onSurface, // 未选中图标的颜色方案r
      navigationBarMutedUnselectedIcon: false, // 禁用未选中图标的颜色变暗效果
      navigationBarIndicatorSchemeColor: SchemeColor.onSecondary, // 导航栏指示器的颜色方案
      navigationBarIndicatorOpacity: 1.00, // 导航栏指示器的不透明度
      navigationBarIndicatorRadius: 10.0, // 导航栏指示器的圆角半径
      navigationBarElevation: 19.0, // 导航栏的阴影高度
      navigationBarHeight: 66.0, // 导航栏的高度
      navigationRailSelectedIconSchemeColor:
          SchemeColor.secondaryContainer, // 选择的图标颜色
    ),
    visualDensity:
        FlexColorScheme.comfortablePlatformDensity, // 设置视觉密度（适配不同平台的显示密度）
  );

  // 深色主题配置
  static ThemeData darkTheme = FlexThemeData.dark(
    scheme: FlexScheme.blueM3,
    surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold,
    blendLevel: 13,
    tabBarStyle: FlexTabBarStyle.forBackground,
    subThemesData: const FlexSubThemesData(
      interactionEffects: false,
      tintedDisabledControls: false,
      blendOnLevel: 20,
      useTextTheme: true,
      defaultRadius: 5.0,
      thinBorderWidth: 0.5,
      bottomNavigationBarElevation: 2.0,
      navigationBarSelectedLabelSchemeColor: SchemeColor.secondary,
      navigationBarUnselectedLabelSchemeColor: SchemeColor.onSurface,
      navigationBarMutedUnselectedLabel: false,
      navigationBarSelectedIconSchemeColor: SchemeColor.secondary,
      navigationBarUnselectedIconSchemeColor: SchemeColor.onSurface,
      navigationBarMutedUnselectedIcon: false,
      navigationBarIndicatorSchemeColor: SchemeColor.onSecondary,
      navigationBarIndicatorOpacity: 1.00,
      navigationBarIndicatorRadius: 10.0,
      navigationBarElevation: 19.0,
      navigationBarHeight: 66.0,
      navigationRailSelectedIconSchemeColor: SchemeColor.secondaryContainer,
    ),
    visualDensity: FlexColorScheme.comfortablePlatformDensity,
  );
  // 返回 themeMode 控制器，使用系统模式
  static ThemeMode themeMode = ThemeMode.system; // 系统控制主题模式
}
